// 配置路由地址
import { permissionRoutes } from './modules/permission';
import { wxRoutes } from './modules/wx';
import { mallRoutes } from './modules/mall';

export const constantRoute = [
  {
    path: "/login",
    name: "Login",
    component: () => import("@/views/login/index.vue"),
    meta: { title: "登录", hidden: true },
  },
  {
    path: "/404",
    name: "404",
    component: () => import("@/views/404/index.vue"),
    meta: { hidden: true },
  },
  {
    path: "/",
    name: "Layout",
    component: () => import("@/views/layout/index.vue"),
    redirect: "/home",
    meta: { hidden: false },
    children: [
      {
        path: "/home",
        name: "Home",
        component: () => import("@/views/home/index.vue"),
        meta: { title: "首页", icon: "HomeFilled", hidden: false },
      },
    ],
  },
  {
    path: "/screen",
    name: "Screen",
    component: () => import("@/views/screen/index.vue"),
    meta: { title: '数据大屏', icon: "Monitor", hidden: false },
  },
];

export const anyRoute = {
  path: "/:pathMatch(.*)*",
  redirect: "/404",
  name: "Any",
  meta: { title: "任意路由", hidden: true },
};


export const asyncRoute = [
  // 权限管理路由
  ...permissionRoutes,
  // 小程序管理路由
  ...wxRoutes,
  // 商城管理路由
  ...mallRoutes,
  // 任意路由
  anyRoute
];